package cn.com.winson.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class IndexController {

	// 定义一个全局的记录器，通过LoggerFactory获取
	private final static Logger logger = LoggerFactory.getLogger(IndexController.class);

	@GetMapping("/")
	public String index(Model model) {
		logger.info("IndexController: {}", "已经收到请求！");
		model.addAttribute("msg", "hello,SpringBoot!");
		return "index";
	}

}
